<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta name="robots" content="noindex,nofollow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="img/style.css" rel="stylesheet" type="text/css" />
<title>添加采集项目</title>
<script src="js/common.js" type="text/javascript"></script>
<script src="js/main.js" type="text/javascript"></script>

</head>
<!--当前导航-->
<body bgcolor="#F7FBFF">
<script type="text/JavaScript">if(parent.$('admincpnav')) parent.$('admincpnav').innerHTML='后台首页&nbsp;&raquo;&nbsp;采集&nbsp;&raquo;&nbsp;自定义采集 ';</script>
<div class="r_main">
<div class="r_content">
	<div class="r_content_1" align=center>
<table class="tb" border="0" cellspacing="0" cellpadding="0">
	<tr class="thead"><th colspan="4">自定义分类</th></tr>
	<tr>
		<td>ID</td>
		<td>要转换的分类名</td>
		<td>影射到系统分类</td>
		<td>操作</td>
	</tr>

<form action="?action=customersavecls" method="post" name="form1">
<?php
$numPerPage=30;
$page = isset($page) ? intval($page) : 1;
if($page==0) $page=1;
if($cofrom==1)
$row = $dsql->GetOne("select count(*) as dd from `sea_co_cls` where cotype=1");
else
$row = $dsql->GetOne("select count(*) as dd from `sea_co_cls` where cotype=0");
if(is_array($row)){
$TotalResult = $row['dd'];
}else{
$TotalResult = 0;
}
$TotalPage = ceil($TotalResult/$numPerPage);
if ($page>$TotalPage) $page=$TotalPage;
$limitstart = ($page-1) * $numPerPage;
if($limitstart<0) $limitstart=0;
if($cofrom==1)
$sqlStr="select id,clsname,sysclsid from `sea_co_cls`  where cotype=1 limit $limitstart,$numPerPage";
else
$sqlStr="select id,clsname,sysclsid from `sea_co_cls`  where cotype=0 limit $limitstart,$numPerPage";
if($TotalResult==0){
?>
	<tr>
		<td colspan="4" align="center">没找到自定义分类</td>
	</tr>
<?php
}else{
$dsql->SetQuery($sqlStr);
$dsql->Execute('customercls');
while($row=$dsql->GetObject('customercls'))
{
$id=$row->id;
?>
	<tr bgcolor="#FFF" style="background-color:#FFF" onmouseover="style.backgroundColor='#E6F2FB'" onmouseout="style.backgroundColor='#FFF'">
		<td style="background:transparent;"><input type="checkbox" value="<?php echo $id;?>" name="e_id[]" class="checkbox"/><?php echo $id;?></td>
		<td style="background:transparent;"><input type="text" name="clsname<?php echo $id;?>" value="<?php echo $row->clsname;?>" /></td>
		<td style="background:transparent;"><select name="tid<?php echo $id;?>"><option value="">请选择数据分类</option><?php if($cofrom==1) makeTypeOptionSelected(0,"&nbsp;|&nbsp;","",$row->sysclsid,1);else makeTypeOptionSelected(0,"&nbsp;|&nbsp;","",$row->sysclsid); ?></select></td>
		<td style="background:transparent;"><a href="?action=customerdelcls&id=<?php echo $id;?>">删除</a></td>
	</tr>
<?php 
}
}
?>
	<tr>
		<td colspan="4"><div class="cuspages"><div class="pages"><label>全选<input type="checkbox" name="chkall" id="chkall" class="checkbox" onclick="checkAll(this.checked,'input','e_id[]')" /></label><label>反选<input type="checkbox" name="chkothers" id="chkothers" class="checkbox" onclick="checkOthers('input','e_id[]')" /></label><input type="submit" value="批量删除" onclick="if(confirm('确定要删除吗')){this.form.action='?action=customerdelallcls';}else{return false}" class="rb1"/>&nbsp;&nbsp;<input type="submit" value="批量修改选中分类" name="Submit" class="rb1" onclick="this.form.action='?action=customersavecls';"/>页次<?php echo $page;?>/<?php echo $TotalPage;?> 每页<?php echo $numPerPage;?>&nbsp;总收录数据条<?php echo $TotalResult;?> <a href="?action=customercls&page=1">首页</a> <a href="?action=customercls&page=<?php echo $page-1;?>">上一页</a> <a href="?action=customercls&page=<?php echo $page+1;?>">下一页</a> <a href="?action=customercls&page=<?php echo $TotalPage;?>">尾页</a>&nbsp;跳转<input type="text"  id="toPage" value="<?php echo $page;?>" style="width:30px"/><button class="rb1" onclick="location.href='?action=customercls&page='+$('toPage').value">跳 转</button></div></div></td>
	</tr>
</form>

	<tr class="thead"><th colspan="4">新增分类转换</th></tr>
<form action="?action=customernewcls" method="post" name="form2">
	<tr>
		<td>添加</td>
		<td><input type="text" name="clsname" value="" /></td>
		<td><select name="tid" id="tid"><option value="">请选择数据分类</option><?php if($cofrom==1) makeTypeOption(0,"&nbsp;|&nbsp;",1); else makeTypeOption(0,"&nbsp;|&nbsp;"); ?></select></td>
		<td><input type="submit" value="确 定" name="Submit" class="rb1"/></td>
	</tr>
</form>
</table>
</div>
</div>
</div>

<div class="bottom">
<table width="100%" cellspacing="5">
<tr>
 <td align="center"><?php echo $cfg_powerby?></td>
</tr>
</table>

</div>

</body>
</html>
